home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / WimpSWIs / c / DLLPoll
Text File  |  1995-07-27  |  2KB  |  93 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    WimpSWIs.DLLPoll.c
  12.     Author:  Copyright © 1995 Julian Smith
  13.     Version: 1.00 (15 Apr 1995)
  14.     Purpose: Simple veneer function for Wimp_Poll which preserves the
  15.              application  starttime as required by Straylight's DLL
  16.              system.
  17.  
  18.              These functions are only needed for the SDLS version of
  19.              DeskLib.
  20. */
  21.  
  22.  
  23.  
  24. #include "DeskLib:WimpSWIs.h"
  25. #include "DLLPollDefs.h"
  26.  
  27.  
  28. #if defined( _DeskLib_SDLS)
  29.  
  30.  
  31.  
  32.  
  33. os_error    *Wimp_Poll3_DLL(
  34.             event_pollmask    mask, 
  35.             event_pollblock    *event,
  36.             void        *pollword
  37.             )
  38. {
  39. event->type = _dll_wimpPoll( mask, &event->data, 0, pollword);
  40.  
  41. if (event->type > 256)
  42.     return (os_error *) (int) event->type;
  43.     /* cc 5 doesn't like casts from an enum directly to a pointer    */
  44. else    return NULL;
  45. }
  46.  
  47.  
  48. os_error    *Wimp_PollIdle3_DLL(
  49.             event_pollmask    mask, 
  50.             event_pollblock    *event,
  51.             int        earliest, 
  52.             void        *pollword
  53.             )
  54. {
  55. event->type = _dll_wimpPollIdle( mask, &event->data, earliest, pollword);
  56.  
  57. if (event->type > 256)
  58.     return (os_error *) (int) event->type;
  59.     /* cc 5 doesn't like casts from an enum directly to a pointer    */
  60. else    return NULL;
  61. }
  62.  
  63.  
  64. /*
  65. Perhaps we could just have, in DeskLib:WimpSWIs.h
  66.  
  67. extern event_type _dll_wimpPoll( 
  68.     event_pollmask mask, event_data *data, int idletime, void *pollword
  69.     );
  70.  
  71. #define Wimp_Poll3_DLL( mask, event, pollword)              \
  72.   (                                \
  73.   event->type = _dll_wimpPoll( mask, &event->data, 0, pollword)    \
  74.   ,                                 \
  75.   ((event)->type<256) ? NULL : (void *) (event)->type        \
  76.   )
  77.  
  78. This gives warning about no context in void vontext or something...
  79.  
  80. */
  81.  
  82.  
  83.  
  84. #else
  85. int    Wimp_Poll__dummy;
  86. /*
  87. To stop cc complaining about 'no extern declaration in translation unit
  88. */
  89.  
  90.  
  91. #endif
  92.  
  93.